import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import {
  renderWithQiankun,
  qiankunWindow
} from 'vite-plugin-qiankun/dist/helper';


let app: VueApp<Element>;
if (!qiankunWindow.__POWERED_BY_QIANKUN__) {
  // createApp(App).use(router).use(ElementPlus).use(createPinia()).mount('#app');
  
createApp(App).mount('#app')
} else {
  console.log(111111)
  renderWithQiankun({
    mount(props) {
      console.log('--mount', document.getElementById('app'));
      console.log('props.container',props.container)
      app = createApp(App);
      app
        .mount(
          (props.container
            ? props.container.querySelector('#app')
            : document.getElementById('app')) as Element
        );
    },
    bootstrap() {
      console.log('--bootstrap');
    },
    update() {
      console.log('--update');
    },
    unmount() {
      console.log('--unmount');
      app?.unmount();
    }
  });
}


